@use "design-system";

/*
  NewUI Container Elements
 */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-x: hidden;
  position: relative;
  align-items: center;
}

// Fix for UI lag on external monitor: https://github.com/MetaMask/metamask-extension/issues/10173
.app.os-mac.browser-chrome::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  background-color: var(--color-background-alternative);
  animation: emptySpinningDiv 1s infinite linear;
}

@keyframes emptySpinningDiv {
  0% { transform: rotate(0deg); }
  to { transform: rotate(1turn); }
}

// Main container
.main-container {
  display: flex;
  flex-direction: column;
  z-index: design-system.$main-container-z-index;
}

.main-container::-webkit-scrollbar {
  display: none;
}

.main-container-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

// main-container media queries

@include design-system.screen-sm-min {
  .main-container {
    &--has-shadow {
      box-shadow: var(--shadow-size-xs) var(--color-shadow-default);
    }
  }
}

@include design-system.screen-md-min {
  .main-container {
    &--has-shadow {
      box-shadow: var(--shadow-size-xs) var(--color-shadow-default);
    }
  }
}

@include design-system.screen-lg-min {
  .main-container {
    &--has-shadow {
      box-shadow: var(--shadow-size-xs) var(--color-shadow-default);
    }
  }
}

.main-container {
  width: 100%;
  overflow-y: auto;
  background-color: var(--color-background-default);
}

.main-container-wrapper {
  flex: 1;
}

// first time
.first-view-main {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;

  @include design-system.screen-sm-max {
    height: 100%;
  }

  @include design-system.screen-sm-min {
    width: 85vw;
  }

  @include design-system.screen-md-min {
    width: 80vw;
  }

  @include design-system.screen-lg-min {
    width: 62vw;
  }
}

.first-view-main-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  padding: 0 10px;
  background: var(--color-background-default);
}

.app.browser-brave.app--sidepanel {
  .main-container,
  .multichain-app-header__contents,
  .page-container,
  .multichain-page,
  .multichain-page__inner-container,
  .multichain-send-page,
  .snaps,
  .permissions-connect,
  .redesigned__send__container,
  .redesigned__send__wrapper {
    min-width: 320px;
  }
}

// Remove once LegacyLayout is removed
.main-container {
  flex: 1;
}

.redesigned__send__wrapper {
  width: 100%;
  background: var(--color-background-default);
}
